package com.cnswhy.cloud.server.core.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.cnswhy.cloud.common.core.base.entity.Entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import java.time.LocalDateTime;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 *
 * </p>
 *
 * @author cnswhy
 * @since 2020-11-05
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("t_customer_wechat")
@ApiModel(value = "CustomerWechat", description = "")
@AllArgsConstructor
public class CustomerWechat extends Entity<Long> {

    private static final long serialVersionUID = 1L;

    /**
     * 商户号
     */
    @ApiModelProperty(value = "商户号")
    @TableField("customer_id")
    @Excel(name = "商户号")
    private Long customerId;

    /**
     * 微信openId
     */
    @ApiModelProperty(value = "微信openId")
    @Length(max = 30, message = "微信openId长度不能超过30")
    @TableField(value = "open_id", condition = LIKE)
    @Excel(name = "微信openId")
    private String openId;

    /**
     * 姓名
     */
    @ApiModelProperty(value = "姓名")
    @Length(max = 10, message = "姓名长度不能超过10")
    @TableField(value = "real_name", condition = LIKE)
    @Excel(name = "姓名")
    private String realName;

    /**
     * 手机
     */
    @ApiModelProperty(value = "手机")
    @Length(max = 11, message = "手机长度不能超过11")
    @TableField(value = "mobile", condition = LIKE)
    @Excel(name = "手机")
    private String mobile;

    /**
     * 微信昵称
     */
    @ApiModelProperty(value = "微信昵称")
    @Length(max = 20, message = "微信昵称长度不能超过20")
    @TableField(value = "nick_name", condition = LIKE)
    @Excel(name = "微信昵称")
    private String nickName;


    @Builder
    public CustomerWechat(Long id, LocalDateTime createTime, LocalDateTime updateTime, Long createUser, Long updateUser,
                          Long customerId, String openId, String realName, String mobile, String nickName) {
        this.id = id;
        this.createTime = createTime;
        this.updateTime = updateTime;
        this.createUser = createUser;
        this.updateUser = updateUser;
        this.customerId = customerId;
        this.openId = openId;
        this.realName = realName;
        this.mobile = mobile;
        this.nickName = nickName;
    }

}
